package com.example.personalizededucationsystem.utils;

import lombok.Getter;

public class VerificationCodeEntry {
    @Getter
    private final String email;
    @Getter
    private final VerificationType type;
    private final long timestamp;

    public VerificationCodeEntry(String email, VerificationType type) {
        this.email = email;
        this.type = type;
        this.timestamp = System.currentTimeMillis();
    }

    public boolean isExpired(long ttlMillis) {
        return System.currentTimeMillis() - timestamp > ttlMillis;
    }
}

